using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.AI;
using UnityEngine.UIElements;
public class RoomBase {
    public ShopEvent Event;
    public List<RoomBase> NextRooms;
    public RoomBase() {
        GameObject go = new();
        Event = go.AddComponent<ShopEvent>();
        NextRooms = new();
    }
    ~RoomBase() {
        MonoBehaviour.Destroy(Event.gameObject);
        Event = null;
    }
}
public class CharacterBase {
    public List<CardBase> Cards = new();
}
public class EventManager : MonoBehaviour {
    public static EventManager Instance;
    public GameManager mng;
    void Awake() {
        Instance = this;
        now_room = new();
        GameObject go = new();
        mng = go.AddComponent<GameManager>();
    }
    void Start() {
        StartEvent();
    }
    private ShopManager shop_manager;
    public ShopManager Shop_Manager {
        get => shop_manager;
    }
    private RoomBase now_room;
    public CharacterBase Player = new();
    public void StartEvent() {
        StartShopEvent(now_room.Event);
    }
    void StartShopEvent(ShopEvent shop) {
        GameObject shop_object = new GameObject("shop_object");
        shop_manager = shop_object.AddComponent<ShopManager>();
        shop_manager.EnterShop(shop);
    }
    public void EndEvent() {
        Destroy(shop_manager.gameObject);
        shop_manager = null;
        Destroy(mng.gameObject);
        mng = null;
        //#if UNITY_EDITOR
        //EditorApplication.isPlaying = false;
        //#else
        //Application.Quit();
        //#endif
    }
}
